package com.rpframework.website.friendly.service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.rpframework.core.BaseService;
import com.rpframework.utils.NumberUtils;
import com.rpframework.website.friendly.dao.ILinkusDao;
import com.rpframework.website.friendly.domain.Linkus;

@Service
public class LinkusService extends BaseService{
	public @Resource ILinkusDao iDao;

	public boolean doSaveOrUpdate(Linkus t) {
		if(NumberUtils.isValid(t.getId())){
			t.setModifyTime(System.currentTimeMillis() / 1000);
			return iDao.update(t);
		}else{
			t.setCreateTime(System.currentTimeMillis()/1000);
			return iDao.insert(t);
		}
	}
}
